﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="ViewCart.aspx.cs" Inherits="ViewCart" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4"
        EmptyDataText="Giỏ hàng của bạn chưa có mặt hàng nào" ForeColor="#333333" OnRowDeleting="GridView1_RowDeleting"
        Width="100%" ShowFooter="True">
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EmptyDataRowStyle Font-Bold="True" Font-Size="18pt" ForeColor="Red" HorizontalAlign="Center"
            BackColor="Yellow" Height="50px" />
        <Columns>
            <asp:BoundField DataField="Maxe" HeaderText="Mã xe" />
            <asp:TemplateField HeaderText="Tên xe">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("TenXe") %>'></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("MaXe", "ProductDetail.aspx?Product={0}") %>'
                        Text='<%# Eval("TenXe") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="GiaBan" DataFormatString="${0}" HeaderText="Đơn Giá" />
            <asp:TemplateField HeaderText="Số lượng" FooterText="Tổng: ">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:TextBox ID="txtSoLuongMua" runat="server" Text='<%# Eval("SoLuongMua") %>' Width="52px"></asp:TextBox>
                    <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtSoLuongMua"
                        ErrorMessage="Số lượng phải lớn hơn 0" Operator="GreaterThan" Type="Integer"
                        ValueToCompare="0"></asp:CompareValidator>
                </ItemTemplate>
                <FooterStyle Font-Bold="True" HorizontalAlign="Right" />
            </asp:TemplateField>
            <asp:BoundField DataField="ThanhTien" DataFormatString="${0}" HeaderText="Thành tiền"
                FooterText="$ 0.00">
                <FooterStyle Font-Bold="True" ForeColor="Red" />
            </asp:BoundField>
            <asp:CommandField ShowDeleteButton="True" />
        </Columns>
        <RowStyle BackColor="#EFF3FB" />
        <EditRowStyle BackColor="#2461BF" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    &nbsp; &nbsp;
    <table border="0" cellpadding="10" cellspacing="0" width="100%">
        <tr>
            <td align="center">
                <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Cập nhật"
                    Width="80px" />&nbsp;
                <asp:Button ID="btnContinue" runat="server" Text="Tiếp tục mua hàng" 
                    Width="120px" onclick="btnContinue_Click" />&nbsp;
                <asp:Button ID="btnClear" runat="server" OnClick="btnClear_Click" Text="Xóa" Width="80px" />&nbsp;
                <asp:Button ID="btnCheckout" runat="server" OnClick="btnCheckout_Click" Text="Đặt hàng"
                    Width="80px" />&nbsp;
            </td>
        </tr>
    </table>
</asp:Content>
